import request from "../../utils/request"
export const LOGIN_TYPE = "login";
export const LOGOUT_TYPE = "logout";
export function login(values) {
    return {
        type: LOGIN_TYPE,
        payload: values
    }
}
export function logout() {
    return {
        type: LOGOUT_TYPE,
    }
}

export function loginAsync(params) {
    return async function (dispatch) {
        const { data } = await request.post('/radmin/login', params);
        dispatch(login(data))
        console.log("cheshi", data);
        return data;
    }
}
export default {
    login,
    logout,
    loginAsync
}
